//
// Created by EDZ on 2021/12/8.
//

#ifndef BASIC_VECTOR_H
#define BASIC_VECTOR_H


class Vector
{
private:
    typedef double* pointer;
    typedef pointer iterator;
    pointer elem;
    pointer first;
    pointer last;
    iterator iter;
    int cursor;
    int size;
public:
    explicit Vector(int sz);
    double& operator[](int i);
    const double& operator[](int i) const;

    iterator operator++();
    iterator operator++(int n);

    void push_back(double e);
    double pop_back();

    iterator begin();
    iterator end();
    ~Vector();
};

void func_vector_invariant();

#endif //BASIC_VECTOR_H
